Skip to content

fix: correct sudo build and add PR CI checks#8

Merged
megheaiulian merged 2 commits intomainfrom
fix/nix-image-sudo-and-cleanup
Feb 10, 2026
Merged

fix: correct sudo build and add PR CI checks#8
megheaiulian merged 2 commits intomainfrom
fix/nix-image-sudo-and-cleanup

Conversation

@megheaiulian
Copy link
Contributor

Summary

Fixes the nix image build failure from #7 and adds CI checks on pull requests so build failures are caught before merge.

Changes

1. Fix sudo setuid path (flake.nix)

The chmod 4755 ./nix/store/*-sudo-*/bin/sudo glob matched nothing because symlinkJoin creates FHS symlinks (./bin/sudo), not a ./nix/store/ tree. Changed to chmod 4755 ./bin/sudofakeroot records the permission and tar --hard-dereference preserves it in the Docker layer.

2. Fix sudoers file conflict (flake.nix)

The writeTextDir "etc/sudoers" in userSetup was silently ignored because symlinkJoin kept the sudo package's own etc/sudoers (first writer wins in lndir). Moved sudoers creation into fakeRootCommands where we rm the symlink and write our own file with @includedir /etc/sudoers.d.

3. Add PR CI workflow (ci.yml)

New .github/workflows/ci.yml that triggers on pull requests and runs build-only checks (no push, no login, no attestation) for all three images:

  • check-basedocker build ./images/base
  • check-nixnix build ./images/nix#dockerImage
  • check-devopsdocker build ./images/devops

This ensures build failures like the one in #7 are caught during code review.

Fix two build failures:

1. chmod 4755 glob ./nix/store/*-sudo-*/bin/sudo matched nothing
   because symlinkJoin creates FHS symlinks (./bin/sudo), not a
   nix store tree. Changed to chmod 4755 ./bin/sudo — fakeroot
   records the permission and tar --hard-dereference preserves it.

2. writeTextDir etc/sudoers was silently ignored because symlinkJoin
   kept the sudo package's own etc/sudoers (first writer wins).
   Moved sudoers creation into fakeRootCommands where we rm the
   symlink and write our own file with @includedir /etc/sudoers.d.
Add a CI workflow that triggers on pull requests and runs build-only
checks (no push) for all three images: base (docker build), nix
(nix build), and devops (docker build). This ensures build failures
are caught during code review rather than after merge.
@megheaiulian megheaiulian merged commit 2e56e33 into main Feb 10, 2026
2 of 3 checks passed
@megheaiulian megheaiulian deleted the fix/nix-image-sudo-and-cleanup branch February 10, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant